/* 
 * File:   main.cpp
 * Author: Faraj
 *
 * Created on May 5, 2013, 3:09 PM
 */
#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include "lib/common/str.h"
#include "lib/common/log.h"
#include "lib/config.h"
#include "headers/microhttpd.h"
#include "web/web_server.h"
/*
 * 
 */

int main() {
    lib::url url("web/test.php");
    lib::config conf("setup.conf");
    if(conf.is_loaded()){
        lib::common::log::info("setup.conf file loaded to memory.");
        lib::resource::conf_apps(&conf, "app");
        lib::common::log::info("applications initialization completed.");
        web::web_server serv;
        serv.conf(&conf, "web");
        lib::common::log::info("web server initialization completed.");
        serv.start();        
        if(serv.is_running()){            
            getchar();
            serv.stop();
        }
        return 0;
    }else{
        lib::common::log::error("please check the setup.conf");
    }    
}